using Microsoft.AspNetCore.Components;
using MudBlazor;
using SageKing.Designer.Core.Contracts;
using SageKing.Designer.Core.Models;
using SageKing.Designer.Core.UI.Contracts;

namespace SageKing.Studio.Pages.Dashboard.Components;
/// <summary>
/// A component that renders the workflow definition properties tab.
/// </summary>
public partial class PropertiesTab
{
    /// <summary>
    /// Gets or sets the workflow definition.
    /// </summary>
    [Parameter] public WorkflowDefinition WorkflowDefinition { get; set; } = default!;

    /// <summary>
    /// Gets or sets the callback that is invoked when the workflow definition is updated.
    /// </summary>
    [Parameter] public EventCallback WorkflowDefinitionUpdated { get; set; }

    [CascadingParameter] private IWorkspace? Workspace { get; set; }
    private bool IsReadOnly => Workspace?.IsReadOnly ?? false;
}